package es.pawer.web.checklists.actions;

import java.util.List;
import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import es.pawer.web.checklists.biz.ChecklistBizDelegate;

/**
 * The action by default
 * @author plozano
 *
 */
public class Welcome extends ClientAwareAction implements SessionAware {
	
	private List<String> existingChecklists=null;

	private String username="Anonymous";
	
	private Map<String, Object> session;
	
	/**
	 * main method of the Action
	 */
	@Override
	public String execute() {
		session.put("username", username);
		existingChecklists=ChecklistBizDelegate.getChecklistNames(username);
		return SUCCESS;

	}

	public List<String> getExistingChecklists() {
		return existingChecklists;
	}

	public void setExistingChecklists(List<String> existingChecklists) {
		this.existingChecklists = existingChecklists;
	}

	@Override
	public void setSession(Map<String, Object> s) {
		this.session=s;
		
	}

}
